package org.lq.er.service.impl;

import java.util.List;

import org.lq.er.dao.AnnouncementDao;
import org.lq.er.dao.impl.AnnouncementDaoImpl;
import org.lq.er.entity.Announcement;
import org.lq.er.service.AnnouncementService;

/**
 * 公告类业务层实现类
 * @author  张鹤山
 *
 */
public class AnnouncementServiceImpl implements AnnouncementService {

	AnnouncementDao ad = new AnnouncementDaoImpl();
	
	/**
	 * 添加公告
	 */
	@Override
	public boolean save(Announcement t) {
		return ad.save(t) > 0;
	}

	/**
	 * 修改公告
	 */
	@Override
	public boolean update(Announcement t) {
		return ad.update(t)>0;
	}

	/**
	 * 删除公告
	 */
	@Override
	public boolean delete(int id) {
		return ad.delete(id)>0;
	}

	/**
	 * 查询公告
	 */
	@Override
	public List<Announcement> findAll() {
		return ad.findAll();
	}

	/**
	 * 根据编号查询公告
	 */
	@Override
	public Announcement getById(int id) {
		return ad.getById(id);
	}

}
